package execption;

import lombok.Getter;

/**
 * @author 张功琰
 * @create 2021-11-16 10:18
 * @Description 错误状态码枚举
 * @Version v1.0
 *
 * 错误码和错误信息定义类
 * 1. 错误码定义规则为5为数字
 * 2. 前两位表示业务场景，最后三位表示错误码。例如：100001。10:通用 001:系统未知异常
 * 3. 维护错误码后需要维护错误描述，将他们定义为枚举形式
 * 错误码列表：
 *  10: 通用
 *      001：参数格式校验
 *      002：短信验证码频率太高
 *  11: 商品
 *  12: 订单
 *  13: 购物车
 *  14: 物流
 *  15：用户
 */
@Getter
public enum BizCodeEnum {
    R_SUCCESS(0,"返回成功"),


    VERSION_EXCEPTION(-1,"当前版本过低，请更新至最新版本"),

    //系统通用异常
    UNKNOW_EXCEPTION(100000,"系统未知异常"),
    VAILD_EXCEPTION(100001,"参数格式校验失败"),
    SMS_SEND_EXCEPTION(100002,"短信发送失败，请稍后再试"),
    TOKEN_ISNULL_EXCEPTION(100003,"token为空"),
    TOKEN_ERROR_EXCEPTION(100004,"令牌解析错误错误，拒绝访问"),
    TOKEN_EXPIRE_EXCEPTION(100005,"该用户已经不存在"),
    MOBILE_NULL_ERROR(100006, "手机号码不能为空"),
    MOBILE_ERROR(100007, "手机号码不正确"),
    ALIYUN_RESPONSE_ERROR(100008, "阿里云短信服务响应失败"),
    ALIYUN_SMS_LIMIT_CONTROL_ERROR(100009, "短信发送过于频繁"),
    ALIYUN_SMS_ERROR(100010, "短信发送失败"),//其他失败
    UPDATE_EXCEPTION(10001,"修改失败"),
    SAVE_EXCEPTION(10002,"保存失败"),
    DELETE_EXCEPTION(10003,"删除失败"),
    INSERT_EXCEPTION(10004,"新增失败"),
    COLLECT_EXCEPTION(10005,"收藏失败"),
    DATABASE_DATA_EXCEPTION(10006, "数据库数据异常"),

    //认证服务异常
    LOGIN_CODE_EXCEPTION(110001,"验证码错误"),
    CODE_EMPTY_EXCEPTION(110006,"验证码不能为空"),
    REGISTER_EXCEPTION(110001,"注册失败"),
    LOGIN_EXCEPTION(110002,"注册失败"),
    SMS_CODE_EXCEPTION(110003,"验证码获取频率太高，请稍后再试"),
    UPDATE_MOBILE_EXCEPTION(110004,"手机号修改失败"),
    UPDATE_MOBILE_IS_BIND(110004,"该手机号已经绑定"),
    MYCODE_EXCEPTION(110005,"获取我的邀请码失败"),

    CONFIGURATION_EXCEPTION(11111,"配置表异常"),

    PRODUCT_UP_EXCEPTION(11000,"商品上架异常"),
    USER_EXIST_EXCEPTION(15001,"存在相同的用户"),
    PHONE_EXIST_EXCEPTION(15002,"存在相同的手机号"),
    NO_STOCK_EXCEPTION(21000,"商品库存不足"),
    LOGINACCT_PASSWORD_EXCEPTION(15003,"账号或密码错误"),
    NULL_PRODUCT_EXCEPTION(11001,"查询商品为空"),
    NULL_CITY_EXCEPTION(10005,"查询城市集合为空"),
    NULL_MEMBER_EXCEPTION(15031,"用户信息为空"),
    INTEGRATION_MESSAGE_EXCEPTION(15032,"获取购物积分记录异常"),
    UPDATE_HEADER_EXCEPTION(15033,"修改头像信息异常"),
    NULL_REDIS_CODE(10031,"验证码失效，请稍后重试"),
    NULL_MYSHOP_EXCEPTION(15033,"查询店铺为空"),
    NULL_PRODUCT_COUNT(15034,"已上传物品数量为空"),
    NULL_PRODUCT_USERCOUNT(15037,"已置换出物品总量为空"),
    NULL_ADDRESS_ENTITY(15035,"获取收获地址为空"),
    GET_MEMBER_EXCEPTION(15036,"获取用户信息失败"),
    GET_PRODUCT_EXCEPTION(11031,"获取商品信息"),
    DELETE_PRODUCT_EXCEPTION(11032,"删除商品失败"),
    FEDBACK_UPDATE_EXCEPTION(15037,"反馈提交失败"),




//    NULL_PRODUCT_EXCEPTION(21001,"查询商品为空"),
    Update_Product_EXCEPTION(11001,"修改物品异常"),
    Uploads_Product_Images_EXCEPTION(11002,"上传图片异常"),
    NULL_Category_EXCEPTION(11003,"查询分类异常"),
    NULL_Category_Label_EXCEPTION(11004,"查询分类标签异常"),
    NULL_Dict_EXCEPTION(11005,"查询字典表为空"),
    Null_Label_EXCEPTION(11006,"查询标签为空"),
    Null_Product_Images_EXCEPTION(11007,"查询商品图片信息为空"),
    Null_MyShop_EXCEPTION(11008,"获取我的店铺信息异常"),
    NULL_Category_Brand_EXCEPTION(11009,"获取分类下的品牌异常"),
    NULL_Brand_EXCEPTION(11010,"获取品牌异常"),
    SAVE_Product_EXCEPTION(11011,"上传物品信息失败"),
    SAVE_Integration_EXCEPTION(11012,"上传积分失败"),
    SupplementarySignature_err_Date(11025,"补签失败，请输入当前日期之前的日期"),


    NULL_ORDER_STATUS(12001,"订单状态为空"),
    NULL_SHOP_ORDER(12002,"未获取到我的订单"),
    NO_FIND_ORDER(12003,"未查找到订单"),
    NO_ORDER_MODIFY(12004,"操作失败"),
    NO_ORDER_READLY(12009,"已经发货，无法取消订单"),
    NO_RECOVER_STSTUS(12010,"取消订单，恢复物品状态"),
    NO_ORDER_DELETE(12005,"订单删除失败"),
    NO_ORDER_DOWNLOAD(12006,"该物品已被置换"),
    NO_CONFIRM_ORDER(12007,"确认收货失败"),
    NO_PRODUCT_TYOE3(12008,"该商品已经被下单"),
    NON_PICK_UP_GOODS(12009, "该商品非待取件商品"),
    PRODUCT_WITHOUT_FINAL_EVALUATION(120060,"商品未经最终评定"),
    PRODUCT_INCORRECT_INFORMATION(1200061,"商品信息不正确"),
    NULL_STORE_HOUSE(14002,"获取仓库信息失败"),
    NO_FIND_STORE(14003,"未查找到仓库"),
    NOTParam(14004,"缺少非必要参数"),
    KeyWord_EXCEPTION(77777,"敏感字异常"),
    NETWORK_EXCEPTION(9999,"网络解析出错"),
    THIRD_EXCEPTION(9998,"调用第三方服务，解析手机号失败"),
    ABNORMAL_ADDRESS_INFORMATION(1000301,"获取地址信息异常"),

    LOW_WATER(15005, "水壶中水量不足");

    private Integer code;

    private String message;

    BizCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
